﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class HintMessage :MonoBehaviour {

    public static HintMessage instance;

    private Image hintMessage;

    private Text message;

    void Awake()
    {
        instance = this;
    } 

    void Start()
    {
        hintMessage = GameObject.Find("Canvas/Panel/hintMessage").GetComponent<Image>();
        message = hintMessage.transform.FindChild("message").GetComponent<Text>();
    }

	public void  Message(string msg)
    {
        hintMessage.gameObject.SetActive(true);
        message.text = msg;
        Invoke("disappear", 2f);
    }

    void disappear()
    {
        hintMessage.gameObject.SetActive(false);
    }

}
